package com.gupaoedu.design.prototype.deep;

import java.util.Date;

/**
 * <p></p>
 *
 * @author Andy
 * @date 2018/3/9.
 */
public class Main {

    public static void main(String[] args) {
        MonkeyKing mk = new MonkeyKing();
        mk.setName("美猴王");
        mk.setBirthDay(new Date());
        mk.setWeight(80);
        mk.setHeight(120);

        GoldBar goldBar = new GoldBar();
        goldBar.setBig(200);
        goldBar.setFeatures("打怪");
        mk.setGoldBar(goldBar);

        MonkeyKing copy = mk.copy(mk);
        //MonkeyKing copy = (MonkeyKing) mk.clone();
        System.out.println(copy);
        System.out.println(mk);

        MonkeyKing deepCopy = (MonkeyKing) mk.deepClone();
        System.out.println(deepCopy);
    }
}
